package com.interview.javabasic.JUC;

import java.util.stream.LongStream;

public class ForkJoinDemo {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        long sum = LongStream.rangeClosed(0L,10_0000_0000L).parallel().reduce(0,Long::sum);
        long end = System.currentTimeMillis();
        System.out.println("Sum: " + sum + "时间: " + (end-start));
    }
}
